import { App } from 'vue'
import { createStore, Store } from 'vuex'

interface state {
  introduce: string
  [propName: string]: any;
}

declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $store: Store<state>,
  }
}

const store = createStore({
  state(): state {
    return {
      introduce: '我不想做介绍'
    }
  }
})

export default {
  install(app: App) {
    app.use(store)
  }
}